<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

<s:if test="%{ comitesC.size() == 0}">
    <tbody class="comiteEticaClass">
        <tr>
            <td>
                <label>Ethic Committee Category</label>
            </td>
            <td>
                <s:select listKey="id"
                          headerKey="-1" headerValue="Choose an option"
                          listValue="name" list="categories"
                          value="" theme="simple"/>
            </td>
        </tr>
        <tr>
            <td>
                <label>Ethic Committee Name</label>
            </td>

            <td>
                <!--It Sends COMMITTEE's ID to Server-->
                <s:textfield theme="simple"
                             name="comitesC[0].id"
                             readonly="true" cssClass="load_hidden"
                             value=""/>

                <!--search field for COMMITTEE-->
                <s:textfield theme="simple" value="" />
                <s:a href="#" onclick="searchComitesEtica(
                                        $(this).prev(),
                                        '%{searchComitesEticaURL}')"
                     theme="simple" >

                    <img src="<s:url value="/images/search.png"/>" alt="search"></s:a>
            </td>

            <td><a onclick="deleteRowCE($(this).parent().parent().parent())"><img src="<s:url value="/images/delete2.png"/>" alt="Delete"></a></td>
        </tr>
    </tbody>
</s:if>
<s:else>
    <s:iterator value="%{comitesC}"  status="stat">
        <tbody class="comiteEticaClass">
            <tr>
                <td>
                    <label>Ethic Committee Category</label>
                </td>
                <td>
                    <s:select listKey="id" listValue="name" list="categories"
                              value="" theme="simple"/>
                </td>
            </tr>
            <tr>
                <td>
                    <label>1-Ethic Committee Name</label>
                </td>

                <td>
                    <s:textfield theme="simple"
                                 name="comitesC[%{#stat.index}].id"
                                 readonly="true" cssClass="load_hidden"
                                 value="%{comitesC[#stat.index].id}"
                            />

                    <s:textfield theme="simple" value="%{comitesC[#stat.index].name}" />
                    <s:a href="#" onclick="searchComitesEtica(
                                        $(this).prev(),
                                        '%{searchComitesEticaURL}')"
                         theme="simple" >

                        <img src="<s:url value="/images/search.png"/>" alt="search"></s:a>
                </td>

                <td><a onclick="deleteRowCE($(this).parent().parent().parent())"><img src="<s:url value="/images/delete2.png"/>" alt="Delete"></a></td>
            </tr>
        </tbody>
    </s:iterator>
</s:else>
<tbody>
    <tr>
        <td></td>
        <td></td>
        <td><a onclick="addRowCommiteeC($(this).parent().parent().parent().prev())">
            <img src="<s:url value="/images/add2.png"/>" alt="Add Row">
        </a></td>
    </tr>
</tbody>
